Skip to content

Conversation

d-v-b
Copy link
Contributor

@d-v-b d-v-b commented Jul 14, 2025

This PR prevents the stateful group tests from deleting the root group

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/user-guide/*.rst
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Jul 14, 2025
@d-v-b d-v-b requested a review from dcherian July 14, 2025 20:05
group_path = data.draw(
st.sampled_from(sorted(self.all_groups)), label="Group deletion target"
)
members = tuple(filter(lambda v: "/" in v, sorted(self.all_groups)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. this will filter out foo/bar too no?
Suggested change
members = tuple(filter(lambda v: "/" in v, sorted(self.all_groups)))
members = tuple(filter(lambda v: v == "/", sorted(self.all_groups)))
  1. Should this op be an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will filter out foo/bar too no?

It will reject any member name that doesn't contain "/", so it will keep foo/bar

Copy link
Contributor

@dcherian dcherian Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused about how this is working. Can you add a comment please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added in 724e3c9

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me know if this explanation needs more context, or if there's just a better way to get the same result -- I'm assuming it's a given that the name of the root group does not contain a "/" character.

@d-v-b
Copy link
Contributor Author

d-v-b commented Jul 14, 2025

closes #3244

@codecov
Copy link

codecov bot commented Jul 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.62%. Comparing base (cea611b) to head (724e3c9).
⚠️ Report is 105 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3243      +/-   ##
==========================================
+ Coverage   92.25%   94.62%   +2.37%     
==========================================
  Files          78       78              
  Lines        8689     8690       +1     
==========================================
+ Hits         8016     8223     +207     
+ Misses        673      467     -206     
Files with missing lines Coverage Δ
src/zarr/testing/stateful.py 98.20% <100.00%> (+59.88%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@d-v-b d-v-b enabled auto-merge (squash) July 14, 2025 20:33
@d-v-b d-v-b merged commit 23010da into zarr-developers:main Jul 14, 2025
28 checks passed
@d-v-b d-v-b deleted the disallow-self-deletion-in-tests branch July 14, 2025 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs release notes Automatically applied to PRs which haven't added release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants